
package com.alex.insistence.rest.banner;

import com.alex.insistence.web.cgform.banner.entity.BannerEntity;
import com.gomore.jeecg.converter.Converter;

/**
 * @author:liyang
 * @time:2017年7月31日 下午7:45:11
 * @since:1.0
 */
public class BannerConverter implements Converter<BannerEntity, RsBanner> {

  private static BannerConverter instance;

  public static synchronized BannerConverter getInstance() {
    if (instance == null) {
      instance = new BannerConverter();
    }
    return instance;
  }

  @Override
  public RsBanner convert(BannerEntity source) {
    if (source == null) {
      return null;
    } else {
      return convert(source, new RsBanner());
    }
  }

  @Override
  public RsBanner convert(BannerEntity source, RsBanner dest) {

    dest = new RsBanner();
    dest.setIsVisiable(source.getIsVisiable());
    dest.setWxAppId(source.getWxAppId());
    return dest;
  }

}
